<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class NoticeStudentResult extends Mailable
{
    use Queueable, SerializesModels;

    private $sender;
    public $title;
    public $name;
    public $college;
    public $major;
    public $scholarship;
    public $budgetFee;
    public $reviewPoint;
    public $interviewPoint;
    public $gpa;
    public $phone;
    public $imgPath;

    public function __construct($title,$name,$college,$major,$scholarship,$budgetFee,$reviewPoint,$interviewPoint,$gpa,$imgPath)
    {
        $this->sender = env('MAIL_USERNAME')??'huiyouint@126.com';
        $this->title = $title;
        $this->name = $name;
        $this->college = $college;
        $this->major = $major;
        $this->scholarship = $scholarship;
        $this->budgetFee = $budgetFee;
        $this->reviewPoint = $reviewPoint;
        $this->interviewPoint = $interviewPoint;
        $this->gpa = $gpa;
        $this->phone = env('MAIL_PHONE','010-86394695');
        $this->imgPath = asset($imgPath);
        Log::info('imgPath:'.$this->imgPath);
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build() {
        return $this->from($this->sender)->subject($this->title)
            ->view('noticeStudentResult');
    }
}
